package com.qf.aop;

import org.springframework.aop.AfterAdvice;
import org.springframework.aop.AfterReturningAdvice;

import java.lang.reflect.Method;

/**
 *  * 前置通知：MethodBeforeAdvice
 *  *
 *  * 后置通知：AfterAdvice
 *  *
 *  * 后置通知：AfterReturningAdvice //有异常不执行，方法会因异常而结束，无返回值
 *  *
 *  * 异常通知：ThrowsAdvice
 *  *
 *  * 环绕通知：MethodInterceptor
 * 我自定义的后置通知
 * @author lixu
 */
public class MyAfterAdvice  implements AfterReturningAdvice {


    /**
     * 后置通知
     * @param returnValue the value returned by the method, if any
     * @param method method being invoked
     * @param args arguments to the method
     * @param target target of the method invocation. May be {@code null}.
     * @throws Throwable
     */
    @Override
    public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
        System.out.println("==5:维修");
        System.out.println("==6:转租");
    }
}
